//@author A0094701J

//This class handles the creation of tasks in general. It calls the utility and
//parser classes to extract and parse user input regarding date and time. It
//contains a separate function for loading tasks during initialization.

//The APIs that this class supports are:
//1. Task create(string &parameters);
//2. vector<Task> loadSession(ostringstream &sessionInfo, vector<string> &invalidTasks);

#ifndef TASKMANAGER_H_
#define TASKMANAGER_H_

#include <istream>
#include <sstream>
#include <QDateTime>
#include "Parser.h"
#include "Logger.h"

#define MESSAGE_INVALID_INPUT "The invalid input is: "
#define MESSAGE_USER_INPUT "User input parsed: "

using namespace std;

class TaskManager {
private:
	int currTaskRef;
	Parser parser;
	Logger logger;

	//Functions that create different task types.
	Task createTask(QString setTitle, QDateTime setStartDate, QDateTime setEndDate,
					QVector<QString> setTags);

	//Functions that process different tasks types.
	Task processFloating(QString &parameters);
	Task processDeadline(QString &parameters);
	Task processMeeting(QString &parameters);
	Task processEvent(QString &parameters);

public:
    TaskManager();

	//Basic task creation function.
	Task create(QString &parameters);
	
	//Function for loading sessions.
	QVector<Task> loadSession(ostringstream &sessionInfo, QVector<QString> &invalidTasks);
};

#endif
